package com.example.springboot.controller;

import com.example.springboot.Result;
import com.example.springboot.domain.Like;
import com.example.springboot.service.LikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/likes")
public class LikeController {
    @Autowired
    LikeService likeService;

    // 点赞和取消
    @PostMapping("/set")
    public Result set(@RequestBody Like likes) {
        likeService.set(likes);
        return Result.success();
    }
}
